package org.example.lottery_system.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.example.lottery_system.common.errorcode.ErrorCode;
@Data
@EqualsAndHashCode(callSuper = true)
public class ControllerException extends RuntimeException{
    private Integer code;
    private String message;

    /**
     * @see org.example.lottery_system.common.errorcode.ControllerErrorCodeConstants
     */
    public ControllerException() {

    }

    public ControllerException(Integer code, String message1) {

        this.code = code;
        this.message = message1;
    }
    public ControllerException(ErrorCode errorCode){
        this.code = errorCode.getCode();
        this.message = errorCode.getMsg();
    }
}
